import java.util.Scanner;

/**
 * ClassName: UserLogin
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author fjorid
 * @Create 2025/2/19 17:37
 * @Version 1.0
 */
public class UserLogin {
    public static void main(String[] args) {
        User user2= new User();
        Scanner scanner = new Scanner(System.in);
        user2 = creatUser(scanner);
        System.out.print("请输入用户名：");
        String inputname = scanner.next();
        System.out.print("请输入密码：");
        String inputpassword = scanner.next();
        if(user2.isLoginSuccess(inputname,inputpassword)){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }


    }
    static User creatUser(Scanner scanner){
        User user1 = new User();
        System.out.println("请输入用户名");
        user1.username = scanner.nextLine();
        System.out.println("请输入用密码 ");
        user1.password = scanner.nextLine();
        System.out.println("用户创建成功");
        return user1;
    }


}
 class User{
    String username ;
    String password ;
     boolean isLoginSuccess(String inputname,String inputpassword){
         return username.equals(inputname)&&password.equals(inputpassword);
     }

}